<template>
  <h6>{{ $store.state.moduleA.name }}</h6>
  <h6>{{ $store.state.moduleB.name }}</h6>

  <!-- 第二种写法 -->
  <h6>{{ $store.state["moduleA"].name }}</h6>
  <h6>{{ $store.state["moduleB"].name }}</h6>

  <h6>{{ $store.getters["moduleA/newUsername"] }}</h6>

  <button @click="$store.commit('moduleA/updateUsername', 'kkkkk')">
    change moduleA username
  </button>

  <!-- <button @click="$store.dispatch('moduleA/getactions')">actions moduleA</button> -->
</template>

<script lang="ts">
import { defineComponent } from "vue";
// 导入ref
// import { ref } from "vue";
export default defineComponent({
  name: "App",
  // 组合式API入口

  setup() {
    // 定义参数
    // 返回值
  },
  components: {},
});
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
